package com.hawk.eye.server.convert;

import com.hawk.eye.common.model.WebhookConfigMessage;
import com.hawk.eye.server.domain.dto.req.OuterWebhookReqDTO;
import com.hawk.eye.server.domain.dto.resp.OuterWebhookRespDTO;
import com.hawk.eye.server.domain.po.OuterWebhook;
import com.hawk.eye.server.domain.vo.req.OuterWebhookReqVO;
import com.hawk.eye.server.domain.vo.resp.OuterWebhookRespVO;
import org.mapstruct.IterableMapping;
import org.mapstruct.Mapper;
import org.mapstruct.Named;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @author zd
 */
@Mapper
public interface OuterWebhookConvert {

    OuterWebhookConvert INSTANCE = Mappers.getMapper(OuterWebhookConvert.class);

    @Named(value = "to")
    OuterWebhookRespDTO to(OuterWebhook webhook);

    WebhookConfigMessage to(OuterWebhookRespDTO webhook);

    @IterableMapping(qualifiedByName = "to")
    List<OuterWebhookRespDTO> toList(List<OuterWebhook> webhooks);

    OuterWebhookReqDTO to(OuterWebhookReqVO reqVO);

    OuterWebhook to(OuterWebhookReqDTO reqDTO);

    OuterWebhookRespVO toRespVO(OuterWebhookRespDTO respDTO);

}